package com.java.service.impl;

import com.java.entity.BlogType;
import com.java.mapper.BlogTypeMapper;
import com.java.service.BlogTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 博客类型Service接口
 * @author Administrator
 *
 */
@Service("blogTypeService")
public class BlogTypeServiceImpl implements BlogTypeService {

    @Resource
    private BlogTypeMapper blogTypeMapper;
    @Override
    public List<BlogType> getBlogType() {
        List<BlogType> blogTypeList = blogTypeMapper.getBlogType();
        blogTypeList = blogTypeList.stream().sorted(Comparator.comparingInt(BlogType::getOrderNo)).collect(Collectors.toList());
        return blogTypeList;
    }
}
